# Default values for openldap-ha.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
  repository: {{ openldap_repo }}
  tag: {{ openldap_tag }}
  pullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

service:
  type: ClusterIP
  port: 389


ldap:
  replication: {% if enableHA is defined and enableHA %}true{% else %}false{% endif %}

  organisation: kubesphere
  domain: kubesphere.io
  adminPassword: admin

persistence:
  enabled: true
{% if persistence.storageClass is defined and persistence.storageClass != "" %}
  storageClass: "{{ persistence.storageClass }}"
{% endif %}
  size: {% if openldap_db_pv_size is defined %}{{ openldap_db_pv_size }}{% else %}{{ common.openldap.volumeSize | default("2Gi") }}{% endif %}


resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

{% if common.openldap.nodeSelector is defined and common.openldap.nodeSelector is not none %}
nodeSelector:
  {{ common.openldap.nodeSelector | to_nice_yaml(indent=2) | indent(2) }}
{% elif nodeSelector is defined and nodeSelector is not none %}
nodeSelector:
  {{ nodeSelector | to_nice_yaml(indent=2) | indent(2) }}
{% else %}
nodeSelector: {}
{% endif %}
{% if common.openldap.tolerations is defined and common.openldap.tolerations is not none %}
tolerations:
  {{ common.openldap.tolerations | to_nice_yaml(indent=2) | indent(2) }}
{% elif tolerations is defined and tolerations is not none %}
tolerations:
  {{ tolerations | to_nice_yaml(indent=2) | indent(2) }}
{% else %}
tolerations: []
{% endif %}

{% if common.openldap.nodeAffinity is defined and common.openldap.nodeAffinity is not none %}
nodeAffinity:
  {{ common.openldap.nodeAffinity | to_nice_yaml(indent=2) | indent(2) }}
{% else %}
nodeAffinity:
  preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 100
      preference:
        matchExpressions:
          - key: node-role.kubernetes.io/master
            operator: In
            values:
              - ""
{% endif %}
